package com.woniu.client;


import com.woniu.client.dto.EmployDto;
import com.woniu.model.Result;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 员工EmployClient服务
 */
@FeignClient(name = "staff-server",path = "/staff")//这里填目标服务名
public interface EmployClient {
    /**
     * 根据账号查询员工对象
     * @param accountId 账号id
     * @return 返回账号对象
     */
    @GetMapping("/employee/findEmployeeByAccountId/{accountId}")
    public Result<EmployDto> findEmployeeByAccountId(
            /*
            账号id
             */
            @ApiParam(name = "accountId",value = "账号id")
            @PathVariable("accountId") String accountId
    );

    /**
     * 根据站点id 查询是否有除负责人外的员工
     * stationId 站点id
     * handlerId 负责人id
     * @return 有true 没有false
     */
    @GetMapping("/employee/isHaveEmploye/{stationId}/{handlerId}")
    public Result<Boolean> isHaveEmploye(@PathVariable("stationId") String stationId,@PathVariable("handlerId") String handlerId
    );


    /**
     * 根据员工id查询员工实体
     * id 员工id
     */
    @GetMapping("/employee/byId/{id}")
    @ApiOperation("根据员工id查询员工实体")
    public Result<EmployDto> byId(@PathVariable("id") @ApiParam("员工") Integer id);


}
